package com.evl.core.vo;

import com.evl.utils.DateUtils;


public class JsonReturnHelper {
	/**
	 * 成功无json响应对象
	 * @return
	 */
	public static BaseResultVo getSuccessWithNull(){
		BaseResultVo resultVo=new BaseResultVo();
		String date=DateUtils.getCurrentDateTime();
		resultVo.setRespTime(date);
		resultVo.setResult(true);
		return resultVo;
	}
	/**
	 * 成功json响应对象
	 * @return
	 */
	public static BaseResultVo getSuccessWithData(Object object){
		BaseResultVo resultVo=new BaseResultVo();
		String date=DateUtils.getCurrentDateTime();
		resultVo.setRespTime(date);
		resultVo.setResult(true);
		resultVo.setData(object);
		return resultVo;
	}
	
	/**
	 * 错误响应对象
	 * @param error
	 * @param errorCode
	 * @return
	 */
	public static BaseResultVo getFailWithError(String error,String errorCode){
		BaseResultVo resultVo=new BaseResultVo();
		String date=DateUtils.getCurrentDateTime();
		resultVo.setRespTime(date);
		resultVo.setResult(false);
		resultVo.setErrorMessage(error);
		resultVo.setErrorCode(errorCode);
		return resultVo;
	}
}
